<template>
  <div class="role-container">
    <!-- 搜索区域 -->
<!--    <div class="search-section">-->
<!--      <el-form :inline="true" :model="searchForm">-->
<!--        <el-form-item label="用户名">-->
<!--          <el-input v-model="searchForm.userName" placeholder="请输入用户名"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="手机号">-->
<!--          <el-input v-model="searchForm.mobile" placeholder="请输入手机号"></el-input>-->
<!--        </el-form-item>-->
<!--&lt;!&ndash;        <el-form-item label="状态">&ndash;&gt;-->
<!--&lt;!&ndash;          <el-select v-model="searchForm.status" placeholder="请选择状态" clearable>&ndash;&gt;-->
<!--&lt;!&ndash;            <el-option label="启用" value="1"></el-option>&ndash;&gt;-->
<!--&lt;!&ndash;            <el-option label="禁用" value="0"></el-option>&ndash;&gt;-->
<!--&lt;!&ndash;          </el-select>&ndash;&gt;-->
<!--&lt;!&ndash;        </el-form-item>&ndash;&gt;-->
<!--        <el-form-item>-->
<!--          <el-button type="primary" @click="handleSearch">查询</el-button>-->
<!--          <el-button @click="resetSearch">重置</el-button>-->
<!--        </el-form-item>-->
<!--      </el-form>-->
<!--    </div>-->

    <!-- 操作按钮区域 -->
<!--    <div class="operation-section">-->
<!--&lt;!&ndash;      <el-button type="primary" @click="handleAdd">新增</el-button>&ndash;&gt;-->
<!--&lt;!&ndash;      <el-button type="danger" size="small" :disabled="!selectedUsers.length" @click="handleBatchDelete">&ndash;&gt;-->
<!--&lt;!&ndash;        批量删除&ndash;&gt;-->
<!--&lt;!&ndash;      </el-button>&ndash;&gt;-->
<!--    </div>-->

    <!-- 表格区域 -->
    <div class="table-section">
      <el-table
          v-loading="loading"
          :data="tableData"
          border
      >
        <el-table-column prop="roleName" label="角色名" align="center"></el-table-column>
        <el-table-column prop="roleCode" label="角色编码" align="center"></el-table-column>
        <el-table-column prop="statue" label="状态" align="center">
          <template slot-scope="scope">
            <el-tag :type="scope.row.status === 1 ? 'primary' :'success'">
              {{ scope.row.status === 1 ? '启用' : '禁用' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="description" label="角色描述" align="center"></el-table-column>
        <el-table-column prop="createTime" label="创建时间" align="center">
          <template slot-scope="scope">
            {{ scope.row.createTime }}
          </template>
        </el-table-column>
<!--        <el-table-column label="操作" fixed="right" align="center">-->
<!--          <template slot-scope="scope">-->
<!--&lt;!&ndash;            <el-button size="medium" type="primary" @click="handleEdit(scope.row)">编辑</el-button>&ndash;&gt;-->
<!--            <el-button-->
<!--                size="medium"-->
<!--                type="danger"-->
<!--                @click="handleDelete(scope.row)"-->
<!--            >删除</el-button>-->
<!--          </template>-->
<!--        </el-table-column>-->
      </el-table>

    </div>

    <!-- 用户表单对话框 -->
    <el-dialog
        :title="dialogTitle"
        :visible.sync="dialogVisible"
        width="500px"
        @close="handleDialogClose"
        append-to-body
    >
      <el-form
          :model="formData"
          label-width="80px"
          size="small"
      >
        <el-form-item label="角色名" prop="roleName">
          <el-input v-model="formData.roleName"></el-input>
        </el-form-item>
        <el-form-item label="角色编码" prop="roleCode">
          <el-input v-model="formData.roleCode"></el-input>
        </el-form-item>
        <el-form-item label="角色描述" prop="roleCode">
          <el-input v-model="formData.description"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="handleSubmit">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script src="./role.js" />

<style lang="scss" scoped src="./role.scss" />